import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib as mpl
import warnings
warnings.filterwarnings("ignore")
# Recover default matplotlib settings
mpl.rcParams.update(mpl.rcParamsDefault)
sns.set_style("white")

# Simple Violin Plot
iris = sns.load_dataset("iris")
plt.figure(figsize=(7,7))
sns.violinplot(x="species" , y = "petal_width" ,data=iris)
plt.show()

employment = pd.read_excel("C:/Users/Lenovo/Desktop/机器学习课程/Data-Visualization-master/Seaborn/Datasets/unemployment.xlsx")
############################################################################################################
sns.violinplot(x=employment.Age, y=employment.Unemployed, hue=employment.Gender, palette='Set2')
plt.show()

sns.violinplot(x=employment.Age, y=employment.Unemployed, hue=employment.Gender, palette='Set2', dodge=False)
plt.show()